package com.jingsheng.jingshengcity.mvp.ui.adapter;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.jingsheng.jingshengcity.R;
import com.jingsheng.jingshengcity.mvp.model.entity.TransactionRecordsEntity;
import com.jingsheng.jingshengcity.mvp.ui.holder.MyViewHolder;

import java.util.List;

/**
 * Created by Administrator on 2017/5/12.
 */

public class TransactionRecordsActivityAdapter extends BaseMultiItemQuickAdapter<TransactionRecordsEntity, MyViewHolder> {

    /**
     * Same as QuickAdapter#QuickAdapter(Context,int) but with
     * some initialization data.
     *
     * @param data A new list is created out of this one to avoid mutable list
     */
    public TransactionRecordsActivityAdapter(List<TransactionRecordsEntity> data) {
        super(data);
        addItemType(TransactionRecordsEntity.DATE, R.layout.adapter_transaction_records_date);
        addItemType(TransactionRecordsEntity.ITEM, R.layout.adapter_transaction_records_item);
    }

    @Override
    protected void convert(MyViewHolder helper, TransactionRecordsEntity item) {
        switch (helper.getItemViewType()) {
            case TransactionRecordsEntity.DATE:
                break;
            case TransactionRecordsEntity.ITEM:
                helper.addOnClickListener(R.id.rl_item);
                break;
        }
    }
}
